package com.java.basis.thread.n3.shunxu;

import lombok.extern.slf4j.Slf4j;
import org.apache.xmlbeans.impl.xb.xsdschema.TopLevelAttribute;
import org.junit.Test;

import java.util.concurrent.locks.LockSupport;

/**
 * @author wangning
 * @create 2022-01-24 16:12
 */
@Slf4j(topic = "c.Test02")
public class Test02 {

	public static void main(String[] args) {
		Thread t1 = new Thread(() -> {
			LockSupport.park();
			log.debug("1");

		});

		Thread t2 = new Thread(() -> {
			log.debug("2");
			LockSupport.unpark(t1);

		});

		t1.start();
		t2.start();

	}
}
